var page = sm("do_Page");
var app = sm("do_App");
var storage = sm("do_InitData");
var nf = sm("do_Notification");
var rootview = ui("$");
var helperOpen = require("helper/open");
var helperOrder = require("helper/order");
var popContent = ui("popContent");
//遮罩显示
var animMaskShow = mm("do_Animator");
var propsMS = {bgColor:"00000077"};
animMaskShow.append(300,propsMS,"EaseOut");
//面板显示
var animPanelShow = mm("do_Animator");
var propsPS = {y:360};
animPanelShow.append(300,propsPS,"Linear");
//遮罩隐藏
var animMaskHide = mm("do_Animator");
var propsMH = {bgColor:"00000000"};
animMaskHide.append(300,propsMH,"EaseIn");
//面板隐藏
var animPanelHide = mm("do_Animator");
var propsPH = {y:-180};
animPanelHide.append(300,propsPH,"EaseIn");

//遮罩事件
var maskbg = ui("bgmask");
maskbg.on("touch","",300,function(){
	popHide();
});
//防止穿透
var bodyp = ui("pbody");
bodyp.on("touch","",300,function(){
	
});
//右边按钮
var popBtnL = ui("popBtnL");
var popBtnLText = ui("popBtnLText");
var popBtnR = ui("popBtnR");
var popBtnRText = ui("popBtnRText");
var orderNo = "";
popBtnL.on("touch","",300,function(){
	if(orderNo){
		helperOrder.sellerSended(orderNo,'2',null,null,'1',function(data,e){
			nf.toast("发货成功");
		});
	}else{
		nf.toast("订单错误");
	}
	popHide();
});
popBtnR.on("touch","",300,function(){
	if(orderNo){
		helperOrder.sellerSended(orderNo,'2',null,null,'2',function(data,e){
			nf.toast("发货成功");
		});
	}else{
		nf.toast("订单错误");
	}
	popHide();
});
//zdy
page.on("popShow",function(data){
	maskbg.visible = true;
	maskbg.animate(animMaskShow);
	bodyp.animate(animPanelShow);
	popContent.text = data.content;
	popBtnLText.text = data.lText;
	popBtnRText.text = data.rText;
	orderNo = data.orderNo;
});
function popHide(){
	maskbg.animate(animMaskHide,function(){
		maskbg.visible = false;
	});
	bodyp.animate(animPanelHide);
};